﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.Http;
using System.Xml.Linq;
using System.Xml;
using System.Text;
using System.Xml.Serialization;

namespace WoodbaseVideoRental.UserControls
{
    public partial class UserList : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            using (HttpClient client = new HttpClient("http://localhost:9090/WVRServices/"))
            {
                using (HttpResponseMessage msg = client.Get("Users"))
                {
                    msg.EnsureStatusIsSuccessful();

                    xmlUserList.DocumentContent = msg.Content.ReadAsString();
                    xmlUserList.TransformSource = Server.MapPath("/Styles/XSLT/UserList.xslt");
                    xmlUserList.DataBind();
                }
            }   
        }
    }
}